package com.oj.dfs;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

public class IntegerDeCompose {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            nValue = scanner.nextInt();
            kValue = scanner.nextInt();
            pValue = scanner.nextInt();
            solver();
            if (maxOrderSum == -1) {
                System.out.println("[]");
            } else {
                System.out.print("[");
                int i = ansList.size()-1;
                for (; i > 0; i--) {
                    System.out.print(ansList.get(i) + " ");
                }
                if (i == 0) {
                    System.out.println(ansList.get(i) + "]");
                }
            }
        }
    }

    public static void solver() {
        init();
        dfs(powerList.size() - 1, 0, 0, 0);
    }

    private static void init() {
        int i = 0;
        int tmp = 0;
        while (i <= nValue) {
            tmp = intPower(i++, pValue);
            if (tmp <= nValue) {
                powerList.add(tmp);
            } else {
                break;
            }
        }
    }

    private static int intPower(int val, int pow) {
        int res = 1;
        for (int i = 0; i < pow; i++) {
            res *= val;
        }
        return res;
    }

    private static List<Integer> powerList = new ArrayList<>();

    private static int nValue;

    private static int kValue;

    private static int pValue;

    private static int maxOrderSum = -1;

    private static LinkedList<Integer> tmpAnsList = new LinkedList<>();

    private static LinkedList<Integer> ansList = new LinkedList<>();

    public static void dfs(int index, int kNum, int valSum, int orderSum) {
        if (kNum == kValue && valSum == nValue) {
            if (orderSum > maxOrderSum) {
                ansList = (LinkedList<Integer>) tmpAnsList.clone();
                maxOrderSum = orderSum;
            }
            return;
        }
        if (kNum > kValue || valSum > nValue) {
            return;
        }
        if (index >= 1) {
            tmpAnsList.push(index);
            dfs(index, kNum + 1, valSum + powerList.get(index),
                    orderSum + index);
            tmpAnsList.pop();
            dfs(index - 1, kNum, valSum, orderSum);
        }
    }
}
